﻿using System;

namespace MathService.DSP.Signals
{
    public class HarmonicSignal : PeriodicDigitalSignal
    {
        protected const double Pi2 = Consts.Geometry.Pi;
        
        protected static double Sin(double x, double f)
        {
            return Math.Sin(Pi2 * f * x);
        }
        protected static double Cos(double x, double f)
        {
            return Math.Cos(Pi2 * f * x);
        }


        public HarmonicSignal(double dx, double A, double f)
            : base(dx, 1 / f)
        {
        	var i_Length = SamplesCount;
        	for(var i = 0; i < i_Length; i++)
                this[i] = A * Sin(i * dx, f);
        }
    }
}
